import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/question',
        name: 'question',
        component: () => import('../views/Question.vue')
      },{
        path: '/shouye',
        name: 'shouye',
        component: () => import('../views/Shouye.vue')
      },{
        path: '/xingqiu',
        name: 'xingqiu',
        component: () => import('../views/Xingqiu.vue')
      },{
        path: '/lingyang',
        name: 'lingyang',
        component: () => import('../views/Lingyang.vue')
      },{
        path: '/public',
        name: 'public',
        component: () => import('../views/Public.vue'),
      }
  ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
